<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center roomDetails_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub roomDetails_fd0_0'>
          <view class='flex flex-wrap align-center roomDetails_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  roomDetails_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='roomDetails_fd0_0_c1_c0'>{{$t('房型详情')}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end roomDetails_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-direction flex-wrap align-stretch roomDetails_fd1_0'>
          <text class='roomDetails_fd1_0_c0'>{{roomDetails.name}}</text>
          <view class='flex flex-wrap align-center roomDetails_fd1_0_c1'>
            <view class='flex flex-wrap align-center'>
              <text class='roomDetails_fd1_0_c1_c0_c0' v-for="(item,index) in apartmentlabel_label_arr" :key="index">{{item}}</text>
            </view>
          </view>
          <view class='flex flex-wrap align-center roomDetails_fd1_0_c1'>
            <text class='roomDetails_fd1_0_c2_c0'>{{$t('面积')}}</text>
            <text class='roomDetails_fd1_0_c2_c1'>{{roomDetails.area}}</text>
            <text class='roomDetails_fd1_0_c2_c1'>{{$t('㎡')}}</text>
          </view>
          <view class='flex flex-wrap align-end roomDetails_fd1_0_c1'>
            <text class='roomDetails_fd1_0_c3_c0'>{{$t('HK$')}}</text>
            <text class='roomDetails_fd1_0_c3_c1'>{{roomDetails.price}}</text>
            <text class='roomDetails_fd1_0_c3_c0'>/月</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center roomDetails_fd1_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch roomDetails_fd1_2'>
          <text class='roomDetails_fd1_2_c0'>{{$t('房型图片')}}</text>
          <view class='flex flex-wrap align-center'>
            <template v-for='(item,key0) in roomDetails.images'>
              <view class='flex flex-wrap align-center roomDetails_fd1_2_c1_c0' :key='key0' @click.stop="lookPrever(roomDetails.images,key0)">
                <image class='roomDetails_fd1_2_c1_c0_c0' mode="aspectFit" :src='item'></image>
              </view>
            </template>

          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "roomDetails": {
          "aid": "",
          "apartmenthouse_name": "",
          "name": "",
          "apartmentlabel_label": "",
          "area": "",
          "price": "",
          "images": [],
          "apartmenthouse_id": "",
          "apartmentlabel_id": "",
          "apartmenttype_name": "",
          "apartmenttype_id": ""
        },
        "id": "1",
        apartmentlabel_label_arr:[],
        language_id:''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.language_id =global.locale
      let {
        id
      } = options
      if (id !== undefined) this.id = id
      this.getroomDetailsFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      lookPrever(list,index){
        uni.previewImage({
          urls:list,
          current:index
        })
      },
      //获取房型详情
      async getroomDetailsFunc() {
        //请求方法
        //数据验证

        let dataroomDetails = await this.$api.get(global.apiUrls.post653a328823f72, {
          aid: this.id
        });

        if (dataroomDetails.data.code != 1) {
          this.$message.info(dataroomDetails.data.msg);
          return
        }
        let inforoomDetails = dataroomDetails.data;
        this.roomDetails = inforoomDetails.data
        this.apartmentlabel_label_arr=this.roomDetails.apartmentlabel_label.split(',')
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .roomDetails_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .roomDetails_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333;
    line-height: 88rpx;
  }

  .roomDetails_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .roomDetails_fd0_0_c0 {
    width: 120rpx;
  }

  .roomDetails_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .roomDetails_fd1_2_c1_c0_c0 {
    width: 216rpx;
    height: 216rpx;
    border-radius: 16rpx;
  }

  .roomDetails_fd1_2_c1_c0 {
    margin: 16rpx 16rpx 0rpx 0rpx;
  }

  .roomDetails_fd1_2_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .roomDetails_fd1_2 {
    padding: 32rpx;
  }

  .roomDetails_fd1_1 {
    background: rgba(248, 248, 248, 1);
    height: 16rpx;
    background-size: 100% auto;
  }

  .roomDetails_fd1_0_c3_c1 {
    color: #F7582F;
    font-size: 36rpx;
    font-weight: 700;
    line-height: 36rpx;
  }

  .roomDetails_fd1_0_c3_c0 {
    color: #F7582F;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .roomDetails_fd1_0_c2_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .roomDetails_fd1_0_c2_c0 {
    color: #999999;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .roomDetails_fd1_0_c1_c0_c0 {
    background: rgba(243, 245, 250, 1);
    color: rgba(106, 124, 143, 1);
    font-size: 22rpx;
    font-weight: 400;
    line-height: 32rpx;
    padding: 0rpx 7rpx 0rpx 7rpx;
    background-size: 100% auto !important;
    margin: 0rpx 10rpx 0rpx 0rpx;
  }

  .roomDetails_fd1_0_c1 {
    margin: 13rpx 0rpx 0rpx 0rpx;
  }

  .roomDetails_fd1_0_c0 {
    color: #333333;
    font-size: 36rpx;
    font-weight: 500;
    line-height: 42rpx;
    margin: 28rpx 0rpx 0rpx 0rpx;
  }

  .roomDetails_fd1_0 {
    padding: 0rpx 32rpx 32rpx 32rpx;
  }
</style>
